<template>
  <j-modal title="回访信息" :width="700" :visible="visible" switchFullscreen @cancel="handleCancel" @ok="handleOk">
    <div class="box">
      <p><span>个案编号：</span>{{ infoObj.caseNo }}</p>
      <p><span>案主姓名：</span>{{ infoObj.realName }}</p>
      <p><span>负责社工：</span>{{ infoObj.belongManagerName }}</p>
      <p><span>开案日期：</span>{{ infoObj.openDate }}</p>
      <p><span>结案日期：</span>{{ infoObj.closureDate }}</p>
    </div>
    <a-tabs default-active-key="1" @change="onTabChange">
      <a-tab-pane key="1" tab="回访信息">
        <p><span>回访日期：</span>{{ infoObj.rvTime }}</p>
        <p><span>回访社工：</span>{{ infoObj.rvPerson }}</p>
        <p><span>回访次数：</span>第 {{ infoObj.rvCount }} 次</p>
        <p><span>回访形式：</span>{{ setTittle(infoObj.rvForm) }}</p>
        <p><span>回访内容：</span>{{ infoObj.rvContent }}</p>
      </a-tab-pane>
    </a-tabs>
    <template slot="footer">
      <p style="text-align: left;">创建人：{{ infoObj.createBy }} <span style="margin-left:30px;">创建时间：{{ infoObj.createTime
          }}</span> </p>
    </template>
  </j-modal>
</template>
<script>
import * as returnVisitApi from '@/api/sjsk/help/returnVisit.js'
export default {
  name: 'detailModal',
  data() {
    return {
      visible: false,
      infoObj: {},
    }
  },
  async created() {
  },
  methods: {
    show(record) {
      this.visible = true
      this.infoObj = record
      // this.getDetail(id)
    },
    getDetail(id) {
      returnVisitApi.getRvRecordDetailById({ rvId: id }).then(res => {
        if (res.success) {
          this.infoObj = res.result
        }
      })
    },
    onTabChange() {

    },
    setTittle(text) {
      return this.$filterDictTextByCache('rvForm', text)  //现在字典中对应的文字，是全局函数
    },
    handleCancel() {
      this.visible = false
    },
    handleOk() {
      this.visible = false
    }
  },
}
</script>
<style lang="less" scoped>
.box {
  span {
    display: inline-block;
    width: 80px;
    text-align: left;
  }
}
</style>
